#include <iostream>
using namespace std;

int main()
{
    int n;
    int m;
    bool pan[4000][4000];
    for (int i = 0; i < 100; i++)
    {
        for (int j = 0; j < 100; j++)
        {
            pan[i][j] = false;
        }
    }
    int x1, y1, x2, y2;
    scanf("%d %d", &n, &m);
    for (int i = 0; i < m; i++)
    {
        scanf("%d %d %d %d", &x1, &y1, &x2, &y2);

        for (int j = 0; j <= x2 - x1; j++)
        {
            for (int k = 0; k <= y2 - y1; k++)
            {
                pan[x1 + j - 1][y1 + k - 1] ^= true;
            }
        }
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            printf("%d", pan[i][j]);
        }
        printf("\n");
    }
}